package com.itheima.StringDemo;

import java.util.Scanner;

public class StringDemo2 {
    public static void main(String[] args) {
        //定义一个变量记住26个英文字母大小写和所有数字
        String str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
        //生成一个n位数的验证码
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        String code = "";
        for (int i = 1; i <= n; i++) {
            int index = (int)(Math.random()*str.length());
            //获取随机索引 根据返回的数字获取对应的字符
            char c = str.charAt(index);
            code += c;
        }
        System.out.println(code);
    }
}
